package com.zhu.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.zhu.domain.Inventory;
import com.zhu.model.inventory.InventoryItemVM;

import java.util.List;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author JoyBoy
 * @since 2022-06-02
 */
public interface InventoryService extends IService<Inventory> {
    /**
     * 功能描述 批量添加库存
     * @author JoyBoyZH
     * @date 2022/6/6
     * @param inventoryList
     * @return boolean
     */
    boolean saveList(List<Inventory> inventoryList);

    boolean saveInventory(Inventory inventory);

    /**
     * 功能描述 通过库存id删除
     * @author JoyBoyZH
     * @date 2022/6/6
     * @param inventoryId
     * @return boolean
     */
    boolean deleteById(Integer inventoryId);

    /**
     * 功能描述 通过仓库id和商品id条件查询库存
     * @author JoyBoyZH
     * @date 2022/6/6
     * @param warehouseId
     * @param goodsId
     * @return com.zhu.domain.Inventory
     */
    Inventory getInventoryByCondition(Integer warehouseId,Integer goodsId);

    /**
     * 功能描述 自定义xml关联查询
     * @author JoyBoyZH
     * @date 2022/6/6
     * @param warehouseId
     * @return java.util.List<com.zhu.model.inventory.InventoryAndGoodsVM>
     */
    List<InventoryItemVM> getByRelevance(Integer warehouseId);

    /**
     * 功能描述 通过商品id查询当前总库存
     * @author JoyBoyZH
     * @date 2022/6/6
     * @param goodsId
     * @return java.lang.Integer
     */
    Integer getGoodsTotalNum(Integer goodsId);

    /**
     * 功能描述 更新库存信息
     * @author JoyBoyZH
     * @date 2022/6/6
     * @param inventory
     * @return boolean
     */
    boolean updateInventory(Inventory inventory);
}
